extends ./public/layout
include ./template/mixin
block title
  title 店铺首页
block header
  include ./template/navbar
block content
   mixin header(shopInfo.template)
   .am-tabs.am-margin-top-sm(data-am-tabs='')
       mixin navStyle(shopInfo.naviStyle,nav)
       .am-tabs-bd.white-background(class="#{shopInfo.listStyle}")
           #tab1.am-tab-panel.am-fade.am-in.am-active.am-padding-left-0.am-padding-right-0.am-padding-bottom-0
               if mainPage.length
                   each product in mainPage
                       mixin proStyle(shopInfo.listStyle,product)
               else
                   .empty-Product
           if productsCount!=0
               if(shopInfo.naviStyle == "navSort")
                   #tab2.am-tab-panel.am-fade.am-padding-left-0.am-padding-right-0.am-padding-bottom-0
                       each products,sort in Products
                           .am-contaier.pro-type.border-bottom-add
                               .am-g.md-line-height.pro-type-title
                                   .am-u-sm-12  #{sort}
                                       span.am-fr.pure-gray #{products.length} &nbsp;
                                            i.directionIcon.am-inline-block.am-icon-angle-right
                               if products.length
                                   each product in products
                                        mixin proStyle(shopInfo.listStyle,product)
                               else
                                   .empty-Product
               else
                    -var index = 2;
                        each products in Products
                            .am-tab-panel.am-fade.am-padding-left-0.am-padding-right-0.am-padding-bottom-0(id="tab#{index}")
                                -index++;
                                if products.length
                                    each product in  products
                                        mixin proStyle(shopInfo.listStyle,product)
                                else
                                    .empty-Product
   //a#cart.cart-true(href="/cart")
block javascript
  script(type="text/javascript" src = "/bower_components/amazeui/dist/js/amazeui.min.js")
  script(type="text/javascript" src = "/public/javascripts/login.js")
  script(type="text/javascript" src = "/public/javascripts/home.js")
  script(type="text/javascript").
    $(function(){
      shop.init();
    });